package com.magic.gre.ui.dialog;

import android.os.Bundle;
import android.view.View;

import com.magic.gre.R;
import com.magic.gre.base.dialog.BaseCenterDialog;

/**
 * Author: Lmoumou
 * Date: 2019-01-29 18:37
 * 文件名: NetHintDialog
 * 描述:
 */
public class NetHintDialog extends BaseCenterDialog {

    private OnNetHintDialogListener onNetHintDialogListener;

    public void setOnNetHintDialogListener(OnNetHintDialogListener onNetHintDialogListener) {
        this.onNetHintDialogListener = onNetHintDialogListener;
    }

    @Override
    protected void initView(View view) {
        view.findViewById(R.id.cancel_tv).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismissThis(isResumed());
            }
        });

        view.findViewById(R.id.sure_tv).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismissThis(isResumed());
                if (onNetHintDialogListener!=null){
                    onNetHintDialogListener.onContinueDowanload();
                }
            }
        });
    }

    @Override
    protected int setViewId() {
        return R.layout.dialog_net_hint;
    }

    @Override
    protected void initBundle(Bundle bundle) {

    }

    public interface OnNetHintDialogListener{
        void onContinueDowanload();
    }
}
